﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Areas.aspx.cs" Inherits="DentScan2.WebApp.Areas" ValidateRequest="false" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:MultiView runat="server" ID="mvAreas" ActiveViewIndex="0">
        <asp:View runat="server" ID="vAreas">
            <asp:Button runat="server" ID="bNew" Text="Нов ред" OnClick="bNew_Click" />
            <asp:Repeater runat="server" ID="rAreas" OnItemCommand="rAreas_ItemCommand">
                <HeaderTemplate>
                    <table border="1" width="100%">
                        <tr>
                            <td>
                                <p class="bold">
                                    Наименование
                                </p>
                            </td>
                            <td>
                                <p class="bold">
                                    Кратко име
                                </p>
                            </td>
                            <td>
                                <p class="bold">
                                    Валута
                                </p>
                            </td>
                            <td>
                                <p class="bold">
                                    Активен
                                </p>
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr>
                        <td>
                            <asp:LinkButton runat="server" ID="lbEdit" CommandArgument='<%#Eval("AreaId")%>'
                                CommandName="EDIT" Text='<%#Eval("AreaName")%>' />
                        </td>
                        <td>
                            <%#Eval("AreaShortName")%>
                        </td>
                        <td>
                            <%#Eval("AWCurrency")%>
                        </td>
                        <td>
                            <asp:LinkButton runat="server" ID="lbDeactivate" CommandArgument='<%#Eval("AreaId")%>'
                                CommandName="DEACTIVATE" Text='<%#Eval("IsDel").ToString()==false.ToString()?"Да":"Не" %>'
                                OnClientClick="return confirm('Моля, потвърдете!');" />
                        </td>
                        <td>
                            <asp:LinkButton runat="server" ID="lbMethods" CommandArgument='<%#Eval("AreaId")%>'
                                CommandName="METHODS" Text="Методи"/>
                        </td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
        </asp:View>
        <asp:View runat="server" ID="vEdit">
            <asp:ValidationSummary ID="vsArea" runat="server" ValidationGroup="vgArea" CssClass="failureNotification" />
            <table>
                <tr>
                    <td>
                        <p class="bold">
                            Име
                        </p>
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="tbAreaName" />
                        <asp:RequiredFieldValidator runat="server" ID="rfvAreaName" ErrorMessage="Моля, въведете Име"
                            ValidationGroup="vgArea" Display="None" ControlToValidate="tbAreaName" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <p class="bold">
                            Кратко име
                        </p>
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="tbAreaShortName" />
                        <asp:RequiredFieldValidator runat="server" ID="rfvAreaShortName" ErrorMessage="Моля, въведете Кратко име"
                            ValidationGroup="vgArea" Display="None" ControlToValidate="tbAreaShortName" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <p class="bold">
                            Цена на час
                        </p>
                    </td>
                    <td>
                        <asp:DropDownList runat="server" ID="ddlHourPrice" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <p class="bold">
                            Цена на час за разглобяване
                        </p>
                    </td>
                    <td>
                        <asp:DropDownList runat="server" ID="ddlDissasemblyHourPrice" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <p class="bold">
                            Цена на час за подготовка
                        </p>
                    </td>
                    <td>
                        <asp:DropDownList runat="server" ID="ddlPreparationHourPrice" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <p class="bold">
                            Валута
                        </p>
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="tbAWCurrency" />
                        <asp:RequiredFieldValidator runat="server" ID="rfvAWCurrency" ErrorMessage="Моля, въведете Валута"
                            ValidationGroup="vgArea" Display="None" ControlToValidate="tbAWCurrency" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <p class="bold">
                            AW за час
                        </p>
                    </td>
                    <td>
                        <asp:DropDownList runat="server" ID="ddlAWToHour" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <p class="bold">
                            ДДС
                        </p>
                    </td>
                    <td>
                        <asp:DropDownList runat="server" ID="ddlVAT" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <p class="bold">
                            Надценка за алуминий
                        </p>
                    </td>
                    <td>
                        <asp:DropDownList runat="server" ID="ddlAlum" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <p class="bold">
                            Надценка за полиране
                        </p>
                    </td>
                    <td>
                        <asp:DropDownList runat="server" ID="ddlPolish" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <p class="bold">
                            Надценка за PNP
                        </p>
                    </td>
                    <td>
                        <asp:DropDownList runat="server" ID="ddlPNP" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <p class="bold">
                            Разрешено е почасово изчисление
                        </p>
                    </td>
                    <td>
                        <asp:CheckBox runat="server" ID="cbCanCaluclateHourly" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <p class="bold">
                            Собствени данни във формуляра
                        </p>
                    </td>
                    <td>
                        <cc1:Editor ID="tbOwnData" runat="server" Height="300px" Width="400px" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Button runat="server" ID="bSave" Text="Запис" OnClick="bSave_Click" />
                    </td>
                    <td>
                        <asp:Button runat="server" ID="bCancel" Text="Отказ" OnClick="bCancel_Click" />
                    </td>
                </tr>
            </table>
        </asp:View>
        <asp:View runat="server" ID="vMethods">
            <asp:CheckBoxList runat="server" ID="cblMethods" DataTextField="MethodName" DataValueField="AWMethodId"></asp:CheckBoxList>
            <asp:Button runat="server" ID="bSaveMethods" Text="Запис" OnClick="bSaveMethods_Click" />
            <asp:Button runat="server" ID="bCancelMethods" Text="Отказ" OnClick="bCancelMethods_Click" />
        </asp:View>
    </asp:MultiView>
</asp:Content>
